import streamlit as st
import numpy as np
from keras.models import load_model

# 加载模型
model = load_model('my_ai_model.h5')

# 设置标题
st.title("House Price Prediction")  # 房价预测模型

# 输入特征值
features = []
for i in range(8):
    features.append(st.number_input(f"Feature {i + 1}"))

if st.button("Predict"):
    # 使用模型进行预测
    prediction = model.predict(np.array(features).reshape(1, -1))
    st.write(f"Predicted Price：{float(prediction[0][0])}")

# 8.3252      41.0  6.984127   1.023810       322.0  2.555556     37.88    -122.23
